﻿<UserControl x:Class="StockholmsStad.Windows.UI.Modules.Couple.Views.TabItemHistoryView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:Converters="clr-namespace:StockholmsStad.Windows.UI.Infrastructure.Converters;assembly=StockholmsStad.Windows.UI.Infrastructure"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <UserControl.Resources>
        <Converters:DateTimeToDateString x:Key="dateTimeConverter" />
    </UserControl.Resources>

    <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Width="Auto">

        <ListView ItemsSource="{Binding History}" ItemContainerStyle="{DynamicResource CustomListViewItemStyle}" 
                  Margin="5,10,5,5" VerticalAlignment="Stretch" Width="Auto" MaxHeight="340" AlternationCount="2"
                  ScrollViewer.VerticalScrollBarVisibility="Auto" 
                  ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                  VirtualizingStackPanel.IsVirtualizing="False">
            <ListView.View>
                <GridView x:Name="GridViewHistory" ColumnHeaderContainerStyle="{DynamicResource GridViewColumnHeaderStyleHistory}">
                    <GridView.Columns>
                        <GridViewColumn Width="Auto" Header="Datum" DisplayMemberBinding="{Binding History, Path=DateTime, Converter={StaticResource dateTimeConverter}}" />
                        <GridViewColumn Width="Auto" Header="Utförd av" DisplayMemberBinding="{Binding History, Path=ModifiedByUser}" />
                        <GridViewColumn x:Name="ColumnDetails" Width="Auto" Header="Detaljer" DisplayMemberBinding="{Binding History, Path=Information}" />
                    </GridView.Columns>
                </GridView>
            </ListView.View>
        </ListView>

    </ScrollViewer>

</UserControl>
